import { useState, useEffect } from 'react'
import PanelLeft from '../../../../../common/PanelLeft';
import { Menu } from 'antd';
import DizhenLayer from './DizhenLayer';
import DizhiLayer from './DizhiLayer';
import QixiangLayer from './QixiangLayer';
import HonglaoLayer from './HonglaoLayer';
import HuozaiLayer from './HuozaiLayer';
import useMap from '../hooks/useMap';
import StatDetail from './common/StatDetail';
import BlockPanel from '../common/BlockPanel';
export default function RiskZoneAnalysis(props) {
    const [selectedKey, setSelectedKey] = useState();
    const map = useMap();
    return <>
        {selectedKey === '1' && <DizhenLayer />}
        {selectedKey === '2' && <DizhiLayer />}
        {selectedKey === '3' && <QixiangLayer />}
        {selectedKey === '4' && <HonglaoLayer />}
        {selectedKey === '5' && <HuozaiLayer />}
        <PanelLeft style={{
            // top: 98
        }}>
            <BlockPanel className="h100" title="风险区划分析">
                <Menu theme='dark' selectedKeys={[selectedKey]} onClick={({ key }) => {
                    setSelectedKey(key);
                    map.dispatchEvent({
                        type: 'detail.show',
                        title: '数据统计',
                        component: <StatDetail type={key} />
                    });
                }} items={[{
                    key: '1',
                    label: '地震灾害风险区划',

                }, {
                    type: 'divider'
                }, {
                    key: '2',
                    label: '地质灾害风险区划'
                }, {
                    type: 'divider'
                }, {
                    key: '3',
                    label: '气象灾害风险区划'
                }, {
                    type: 'divider'
                }, {
                    key: '4',
                    label: '洪涝灾害风险区划'
                }, {
                    type: 'divider'
                }, {
                    key: '5',
                    label: '林竹火灾风险区划'
                }]}></Menu>
            </BlockPanel>
        </PanelLeft>
    </>;
}